GtkButton: Remove unneeded gtk_style_context_notify_state_change() calls
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Nov 2010 02:04:20 +0000 (03:04 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:41 +0000 (15:39 +0100)
There is now code to handle this for one-item widgets (such as GtkButton)
in gtk_widget_set_state_flags()

gtk/gtkbutton.c

index 4390424dcbfc82c2df04f10ce1276664e2a4fb87..cbfbdcb072c8a91d9c3f42efcf3a4bfdde7a012b 100644 (file)
@@ -1762,18 +1762,6 @@ gtk_button_enter_notify (GtkWidget        *widget,
     {
       priv->in_button = TRUE;
       gtk_button_enter (button);
-
-      if (gtk_widget_get_realized (widget) &&
-          gtk_widget_is_drawable (widget))
-        {
-          GtkStyleContext *context;
-
-          context = gtk_widget_get_style_context (widget);
-          gtk_style_context_notify_state_change (context,
-                                                 gtk_widget_get_window (widget),
-                                                 NULL, GTK_STATE_PRELIGHT,
-                                                 button->in_button);
-        }
     }
 
   return FALSE;
@@ -1792,18 +1780,6 @@ gtk_button_leave_notify (GtkWidget        *widget,
     {
       priv->in_button = FALSE;
       gtk_button_leave (button);
-
-      if (gtk_widget_get_realized (widget) &&
-          gtk_widget_is_drawable (widget))
-        {
-          GtkStyleContext *context;
-
-          context = gtk_widget_get_style_context (widget);
-          gtk_style_context_notify_state_change (context,
-                                                 gtk_widget_get_window (widget),
-                                                 NULL, GTK_STATE_PRELIGHT,
-                                                 button->in_button);
-        }
     }
 
   return FALSE;
@@ -2292,18 +2268,6 @@ _gtk_button_set_depressed (GtkButton *button,
 
   if (depressed != priv->depressed)
     {
-      if (gtk_widget_get_realized (widget) &&
-          gtk_widget_is_drawable (widget))
-        {
-          GtkStyleContext *context;
-
-          context = gtk_widget_get_style_context (widget);
-          gtk_style_context_notify_state_change (context,
-                                                 gtk_widget_get_window (widget),
-                                                 NULL, GTK_STATE_ACTIVE,
-                                                 depressed);
-        }
-
       priv->depressed = depressed;
       gtk_widget_queue_resize (widget);
     }